#include<bits/stdc++.h>
using namespace std;
using ll = long long;
ll n;//yizhong
char mp[110][110];
int d[110][110];
int dx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
string s = "yizhong";
void dfs(ll x,ll y)
{
    for (ll i = 0; i < 8;i++)
    {
        ll tx = x + dx[i], ty = y + dy[i], ans = 1;
        for (ll j = 0; j < s.size();j++)
        {
            tx = x + j * dx[i];
            ty = y + j * dy[i];
            if(mp[tx][ty]!=s[j])
            {
                ans = 0;
                break;
            }
        }
        if (ans == 0)
        {
            continue;
        }
        for (ll j = 0; j < s.size(); j++)
        {
            ll tx = x + j * dx[i];
            ll ty = y + j * dy[i];
            d[tx][ty] = 1;
        }
    }
}
int main()
{
    cin >> n;
    for (ll i = 1; i <= n;i++)
    {
        for (ll j = 1; j <= n;j++)
        {
            cin >> mp[i][j];
        }
    }
    for (ll i = 1; i<= n;i++)
    {
        for (ll j = 1; j <= n;j++)
        {
            if(mp[i][j]!='y')
            {
                continue;
            }
                dfs(i, j);
            
        }
    }
    for (ll i = 1; i <= n;i++)
    {
        for (ll j = 1; j <= n;j++)
        {
            if(d[i][j]==1){
                cout << mp[i][j];
            }
            else
                cout << "*";
        }
        cout << "\n";
    }
        return 0;
}